<%inherit file="/en/base.html" />

<table>
% for r in sorted(ctx.regions.keys()):

    <tr>
        <td style="padding:0px ${ctx.regions[r].level*20}px">
            <a href="/regions/view?region=${ctx.regions[r].key()}">${ctx.regions[r].name|h}</a>
        </td>
    </tr>
% endfor
    <tr>
        <td>
            <h3>${ctx.region.name|h}</h3>
        </td>
            % if ctx.is_admin:
            <td>
                <a href="#">delete</a>&nbsp;
                <a href="/regions/edit?region=${ctx.regions[r].key()}">edit</a>
                % if ctx.regions[r].level < 4:
                    <a href="/regions/new?region_parent=${ctx.regions[r].key()}">Add sub region</a></td></tr>
                % endif
            </td>
            % endif
    </tr>

</table>
<p>
    ${ctx.region.desc|h,ctx.h.replws}
</p>
<hr>
Subregions:
<table>
% for r in ctx.region.get_subregions():
<tr><td><a href="/regions/view?region=${r.key()}">${r.name|h}</a></td></tr>
% endfor    
</table>
